package com.ankicoo.practice.daily;

public class LC1678 {
    public static void main(String[] args) {
        String command = "G()(al)";
        command = command.replaceAll("\\(\\)","o");
        System.out.println(command);
        command = command.replaceAll("\\(al\\)","al");
        System.out.println(command);
    }

    public int countConsistentStrings(String allowed, String[] words) {
        int sum = 0;
        for(String word:words){
            for(int i = 0 ;i<allowed.length(); i++){
                word = word.replaceAll(String.valueOf(allowed.charAt(i)),"");
            }
            if(word.length()>0){
                sum+=1;
            }
        }
        return sum;
    }
}
